package com.dwxt.race.service.feign;


import com.dwxt.common.base.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient("pay")
public interface PayService {
    //支付宝支付
    @RequestMapping("/mall/zfb/createOrderWithZFB")
    public BaseResult createOrderWithZFB(@RequestParam String category,@RequestParam String name,@RequestParam Integer number,@RequestParam Integer integral,@RequestParam Double realPrice);
    //微信支付
    @RequestMapping("/mall/wx/createOrderWithWX")
    public BaseResult createOrderWithWX(@RequestParam String category,@RequestParam String name,@RequestParam Integer number,@RequestParam Integer integral,@RequestParam Double realPrice);

    @RequestMapping("/pay/wx")
    public BaseResult payWithWX(@RequestBody Map<String,String> params) throws Exception;

    @RequestMapping("/pay/wx/query")
    public BaseResult wxQueryPayResult(String orderId) throws Exception;

    @RequestMapping("/pay/wx/refund")
    public BaseResult wxRefund(@RequestParam String orderId, @RequestParam Double price) throws Exception;

    @RequestMapping("/pay/zfb")
    public BaseResult payWithZFB(@RequestBody Map<String, String> params) throws Exception;

    @RequestMapping("/pay/zfb/query")
    public BaseResult zfbQueryPayResult(String orderId) throws Exception;

    @RequestMapping("/pay/zfb/refund")
    public BaseResult zbfRefund(@RequestParam String orderId, @RequestParam Double price) throws Exception;
}
